package models

//对请求结果的解析返回的内容
type ParseRequestResult struct {
	Items    interface{} //数据
	Requests []Request   //如果还要继续往下面爬则构成下级爬取的请求集合
}

//每个请求包含的基本元素
type Request struct {
	Url            string
	Header         Header
	PostData       string //post时要提交的数据
	ReqFunc        func(url string, header map[string]string, data string) (res []byte, err error)
	Parser         func([]byte, DataFromParent) (ParseRequestResult, error)
	ParserName     string
	DataFromParent DataFromParent
}

type Header map[string]string
type DataFromParent map[string]interface{}
